<template>
  <div class="login-container">
    <div class="login-content">
      <div class="login-title">数字化产品运营管理系统</div>
      <el-steps :active="active" finish-status="success" simple>
        <el-step title="填写手机号"></el-step>
        <el-step title="完善信息"></el-step>
        <el-step title="注册成功"></el-step>
      </el-steps>
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
  export default {
    name: "index",
    data() {
      console.log(this.$router)
      console.log(this.$route.path)
      return ({
        resetPassword: '/resetPassword',
        signUp: '/signUp',
      })
    },
    computed: {
      active: function() {
        console.log(this.$route.path)
        return +_.last(this.$route.path.split('part')) - 1
      }
    },
    methods: {
    },
    mounted() {
      if (+_.last(this.$route.path.split('part')) !== 1) {
        this.$router.replace({path: '/enterpriseSignUp/part1'});
      }
    },
    beforeUpdate() {
      if (this.$store.state.signForm.step < this.active + 1) {
        this.$router.replace({path: '/enterpriseSignUp/part1'});
      }
    }
  }
</script>

<style lang="less" scoped>
  .login-container {
    height: 100%;
    width: 100%;
    background-color: #172D40;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .login-content {
    width: 600px;
    background-color: #30495B;
  }
  .login-form {
    margin: 40px 120px;
  }
  .login-title {
    text-align: center;
    font-size: 24px;
    color: white;
    margin-top: 40px;
  }
  .extral-link {
    display: flex;
    justify-content: space-between;
    margin-top: -20px;
  }
</style>
<style lang="less">
  .ruleForm > div > label {
    color: white;
  }
</style>
